/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.ucsur.tp.colegio.form;

import edu.ucsur.tp.colegio.beans.AlumnoBean;
import edu.ucsur.tp.colegio.beans.DistritoBean;
import edu.ucsur.tp.colegio.beans.ProvinciaBean;
import edu.ucsur.tp.colegio.beans.RegionBean;
import edu.ucsur.tp.colegio.beans.SexoBean;
import edu.ucsur.tp.colegio.dao.factories.SchoolDaoFactory;
import edu.ucsur.tp.colegio.daos.AlumnoSchoolDao;
import java.text.SimpleDateFormat;
import javax.swing.JOptionPane;

/**
 *
 * @author Administrador
 */
public class Ventana_Alumno extends javax.swing.JInternalFrame {

    SchoolDaoFactory factory = SchoolDaoFactory.getInstance(SchoolDaoFactory.TEMP_DATA);
    
    /**
     * Creates new form Ventana_Alumno
     */
    public Ventana_Alumno() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        cboTipoSexoAlumno = new javax.swing.JComboBox();
        jLabel11 = new javax.swing.JLabel();
        txtTutorAlumno = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        txttelefonoTutorAlumno = new javax.swing.JTextField();
        txtIDEduc = new javax.swing.JTextField();
        txtCodigoAlumno = new javax.swing.JTextField();
        txtNombreAlumno = new javax.swing.JTextField();
        txtApePaterAlumno = new javax.swing.JTextField();
        txtApeMaterAlumno = new javax.swing.JTextField();
        txtFecNacAlumno = new javax.swing.JTextField();
        txtEmailTutorAlumno = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        cboprovinciaAlumno = new javax.swing.JComboBox();
        jLabel16 = new javax.swing.JLabel();
        cboregiónAlumno = new javax.swing.JComboBox();
        jLabel17 = new javax.swing.JLabel();
        cbodistritoAlumno = new javax.swing.JComboBox();
        btnNuevoAlumno = new javax.swing.JButton();
        btnGuardarAlumno = new javax.swing.JButton();
        btnModificarAlumno = new javax.swing.JButton();
        btneliminarAlumno = new javax.swing.JButton();
        btnSalirAlumno = new javax.swing.JButton();

        setBackground(new java.awt.Color(0, 204, 204));
        setTitle("REGISTRAR NUEVOS ALUMNOS");

        jPanel1.setBackground(new java.awt.Color(0, 204, 204));
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Ingresar los Datos del Alumno"));

        jLabel5.setText("ID Educativo :");

        jLabel2.setText("Codigo :");

        jLabel7.setText("Nombre :");

        jLabel14.setText("Apellido Paterno :");

        jLabel15.setText("Apellido Materno :");

        jLabel9.setText("Fecha de Nac :");

        jLabel8.setText("Sexo :");

        cboTipoSexoAlumno.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Masculino", "Femenino", "" }));

        jLabel11.setText("Responsable :");

        jLabel10.setText("Email de contacto :");

        jLabel13.setText("Telefono :");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addGap(74, 74, 74)
                        .addComponent(cboTipoSexoAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addGap(33, 33, 33)
                        .addComponent(txtTutorAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel10)
                            .addComponent(jLabel13))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 10, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtEmailTutorAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txttelefonoTutorAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(23, 23, 23))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addGap(18, 18, 18)
                        .addComponent(txtApePaterAlumno))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(jLabel5)
                            .addComponent(jLabel7))
                        .addGap(35, 35, 35)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtIDEduc, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtCodigoAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtNombreAlumno)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel15)
                            .addComponent(jLabel9))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtFecNacAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtApeMaterAlumno))))
                .addContainerGap(24, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addGap(7, 7, 7)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(txtIDEduc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(7, 7, 7)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel2)
                    .addComponent(txtCodigoAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(txtNombreAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(10, 10, 10)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(txtApePaterAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(13, 13, 13)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(txtApeMaterAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel9)
                    .addComponent(txtFecNacAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cboTipoSexoAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(txtTutorAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(txtEmailTutorAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(txttelefonoTutorAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanel2.setBackground(new java.awt.Color(0, 204, 204));
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Dirección del Alumno"));

        jLabel12.setText("Provincia :");

        cboprovinciaAlumno.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Tumbes", "Piura", "Lambayeque", "La Libertad", "Cajarmarca", "San Martín", "Amazonas", "Loreto", "Ancash", "Lima", "Provincia Constitucional del Callao", "Húanuco", "Huancavelica", "Ica", "Pasco", "Junin", "Ucayali", "Ayacucho", "Apurimác", "Arequipa", "Moquegua", "Tacna", "Cusco", "Puno", "Madre de Dios", " ", " " }));

        jLabel16.setText("Región :");

        cboregiónAlumno.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Bagua", "Bongará", "Chachapoyas", "Luya", "Rodríguez de Mendoza", "Utcubamba", "Aija", "Antonio Raimondi", "Asunción", "Bolognesi", "Carhuaz", "Casma", "Huaraz", "Huaylas", "Abancay", "Andahuaylas", "Grau", "Arequipa", "Camaná", "Castilla", "Caylloma", "Cajamarca", "Celendín", "Chota", "Jaén", "Callao", "Acomayo", "Anta", "Canchis", "Ica", "Nazca", "Palpa", "Pisco", "Chiclayo", "Trujillo", "Virú", "Lima", "Barranca", "Cajatambo", "Cañete", "Huaral", "\t", " ", " ", " ", " " }));

        jLabel17.setText("Distrito :");

        cbodistritoAlumno.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Aramango", "La Peca", "Chisquilla", "Jazan", "Huancas", "Leimebamba", "Tingo", "Yupan", "Huanchay", "Jangas", "Carmen Alto", "Tambillo", "Santillana", "Cochabamba", "Paccha", "Chilete", "Tantarica", "Socota", "Chancay", "Ichocán", "Ancahuasi", "Rondocan", "Pueblo Nuevo", "El Carmen", "Chincha Baja", "Chavín", "Chilca", "Ancón", "Ate", "Barranco", "Breña", "Carabayllo", "Chorrillos", "Cieneguilla", "Jesús María", "Comas", "La Molina", "Lince", "Miraflores", "Bellavista", "Carmen de la Legua Reynoso", "La Punta", "Ventanilla", "La Perla", " " }));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel17)
                        .addGap(18, 18, 18)
                        .addComponent(cbodistritoAlumno, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel16)
                        .addGap(18, 18, 18)
                        .addComponent(cboregiónAlumno, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(cboprovinciaAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 164, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(cboprovinciaAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(cboregiónAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(cbodistritoAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        btnNuevoAlumno.setText("NUEVO");
        btnNuevoAlumno.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnNuevoAlumno.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnNuevoAlumno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNuevoAlumnoActionPerformed(evt);
            }
        });

        btnGuardarAlumno.setText("GUARDAR");
        btnGuardarAlumno.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnGuardarAlumno.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnGuardarAlumno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGuardarAlumnoActionPerformed(evt);
            }
        });

        btnModificarAlumno.setText("MODIFICAR");
        btnModificarAlumno.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnModificarAlumno.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnModificarAlumno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnModificarAlumnoActionPerformed(evt);
            }
        });

        btneliminarAlumno.setText("ELIMINAR");
        btneliminarAlumno.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btneliminarAlumno.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btneliminarAlumno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btneliminarAlumnoActionPerformed(evt);
            }
        });

        btnSalirAlumno.setText("SALIR");
        btnSalirAlumno.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnSalirAlumno.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnSalirAlumno.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSalirAlumnoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(29, 29, 29)
                                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(62, 62, 62)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(btnNuevoAlumno, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(btnModificarAlumno, javax.swing.GroupLayout.Alignment.TRAILING))
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(btnGuardarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(btneliminarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addContainerGap(14, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnSalirAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(90, 90, 90))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnNuevoAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnGuardarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(btnModificarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(7, 7, 7))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(btneliminarAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)))
                        .addComponent(btnSalirAlumno, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(19, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnNuevoAlumnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNuevoAlumnoActionPerformed

    }//GEN-LAST:event_btnNuevoAlumnoActionPerformed

    private void btnGuardarAlumnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGuardarAlumnoActionPerformed

        SimpleDateFormat sdf1 = new SimpleDateFormat("dd/MM/yyyy");
        
        try{
              //--** Instanciando una clase del Alumno (JavaBean)
            
            AlumnoBean alumno = new AlumnoBean();
            
            //--** Seteando los valores de los controles de la GUI a los atributos de la instancia
            
            alumno.settxtIDEduc(txtIDEduc.getText());
            alumno.settxtCodigoAlumno(txtCodigoAlumno.getText());
            alumno.settxtNombreAlumno(txtNombreAlumno.getText());
            alumno.settxtApePaterAlumno(txtApePaterAlumno.getText());
            alumno.settxtApeMaterAlumno(txtApeMaterAlumno.getText());
            alumno.settxtFecNacAlumno(sdf1.parse(txtFecNacAlumno.getText()));
            alumno.setSexo(new SexoBean((String)cboTipoSexoAlumno.getSelectedItem(), "")); 
            alumno.settxtTutorAlumno(txtTutorAlumno.getText());
            alumno.settxtEmailTutorAlumno(txtEmailTutorAlumno.getText());
            alumno.setcodigoprovincia(new ProvinciaBean((String)cboprovinciaAlumno.getSelectedItem(), ""));
            alumno.setcodigoregion(new RegionBean((String)cboregiónAlumno.getSelectedItem(), ""));
            alumno.setcodigodistrito(new DistritoBean((String)cbodistritoAlumno.getSelectedItem(), ""));
            
      //--** Agregando el usuario instanciado a la data 
      //--** (luego se debe reemplazar por data en base de datos)
            //ListaAlumnosData.listaAlumno.add(alumno);
           AlumnoSchoolDao alumnoDao = factory.getAlumnos();
           alumnoDao.insertar(alumno);
           
        }catch (Exception ex) {
      ex.printStackTrace();
      JOptionPane.showMessageDialog(null, "Se Grabo Correctamente El Mantenimiento Alumno ");
    }
        
    }//GEN-LAST:event_btnGuardarAlumnoActionPerformed

    private void btnModificarAlumnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnModificarAlumnoActionPerformed

    }//GEN-LAST:event_btnModificarAlumnoActionPerformed

    private void btneliminarAlumnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btneliminarAlumnoActionPerformed

    }//GEN-LAST:event_btneliminarAlumnoActionPerformed

    private void btnSalirAlumnoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalirAlumnoActionPerformed
this.dispose();
    }//GEN-LAST:event_btnSalirAlumnoActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnGuardarAlumno;
    private javax.swing.JButton btnModificarAlumno;
    private javax.swing.JButton btnNuevoAlumno;
    private javax.swing.JButton btnSalirAlumno;
    private javax.swing.JButton btneliminarAlumno;
    private javax.swing.JComboBox cboTipoSexoAlumno;
    private javax.swing.JComboBox cbodistritoAlumno;
    private javax.swing.JComboBox cboprovinciaAlumno;
    private javax.swing.JComboBox cboregiónAlumno;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JTextField txtApeMaterAlumno;
    private javax.swing.JTextField txtApePaterAlumno;
    private javax.swing.JTextField txtCodigoAlumno;
    private javax.swing.JTextField txtEmailTutorAlumno;
    private javax.swing.JTextField txtFecNacAlumno;
    private javax.swing.JTextField txtIDEduc;
    private javax.swing.JTextField txtNombreAlumno;
    private javax.swing.JTextField txtTutorAlumno;
    private javax.swing.JTextField txttelefonoTutorAlumno;
    // End of variables declaration//GEN-END:variables
}
